package com.patterns.chain;

public class Test {
	public static void main(String[] args) {
		//组装责任链
		Leader director = new DirectorLeader("主任");
		Leader manager = new ManagerLeader("经理");
		Leader generalManager = new GeneralManagerLeader("总经理");
		
		director.setNextLeader(manager);
		manager.setNextLeader(generalManager);
		
		//员工张三请假2天审批过程
		director.handleRequest(new LeaveRequest("张三", "市场部", 2, "世界那么大，想出去看看"));
		//员工李四请假4天审批过程
		director.handleRequest(new LeaveRequest("李四", "市场部", 4, "吃的太饱，回家睡觉"));
		//员工王五请假8天审批过程
		director.handleRequest(new LeaveRequest("王五", "市场部", 8, "家里母猪要生崽"));
		//员工王麻子请假5年审批过程
		director.handleRequest(new LeaveRequest("王麻子", "市场部", 5*365, "世界大战啦"));
	}
}
